import os
import sys

from airflow.jobs.scheduler_job import SchedulerJob

os.environ['AIRFLOW__CORE__LOGGING_LEVEL'] = 'ERROR'
os.environ['AIRFLOW__LOGGING__LOGGING_LEVEL'] = 'ERROR'
job = SchedulerJob.most_recent_host_job()
is_alive = job.is_alive()

sys.exit(0 if is_alive else 1)


